Ok guys i have the fixed version!
Fixed the bad typo!
-------------------------------------------
| News Fader Hack (For UBB 6.0, Gold [Earthquake])
| Version: 1.0
| By: Slurpee (Brett Norton)
| Web Site:
http://www.vhlinks.com -------------------------------------------------------------------------------------
This hack will fade in news headlines that you dictate via the control panel in a table row above your forums.
If you are curious how it looks, visit my forums at
http://www.vhforums.com for an example.
This is a pretty extensive hack, so make sure and back up all your files first BEFORE making any changes.
First thing is to upload the contents of this zip file to the following folders:
fade.gif -> To your non-cgi folder
fader.js -> To your non-cgi folder
newsfader.txt -> To your non-cgi folder
cp_vars_news_fader_.pl -> To your Templates directory
cp_news_fader.cgi -> To your cgi-bin folder (CHMOD this file 755)
vars_news_fader.cgi -> To your variables folder (most likely your cgi-bin folder)- CHMOD this file 777
Ok next the files that need to be edited:
** EDIT CP.CGI **
Look for the following code:
if (($ubb eq "set_cats") && ($status eq "Administrator")) {
require "$vars_config{CGIPath}/cp_forums.cgi";
&set_cats; exit;
} #end set_cats
Underneath this add:
if (($ubb eq "vars_news_fader") && ($status eq "Administrator")) {
require "$vars_config{CGIPath}/cp_news_fader.cgi";
&NewsFaderSettings; exit;
} #end vars_news_fader
if (($ubb eq "set_vars_news_fader") && ($status eq "Administrator")) {
require "$vars_config{CGIPath}/cp_news_fader.cgi";
&SetNewsFaderSettings; exit;
} #end set_vars_news_fader
** DONE - SAVE AND CLOSE CP.CGI **
** EDIT UBB_FORUM_SUMMARY.CGI **
Look for the following code:
} #each cat
$ThisHTML .= &Cat_Page_Bottom;
} #end cat only view
Underneath that code add the following:
sub ReadNews {
$the_page = "";
$newspage = "$vars_config{NonCGIPath}/newsfader.txt";
open(NEWS,"<$newspage");
@lines = <NEWS>;
close(NEWS);
$the_page = join('', @lines);
}
** DONE - SAVE AND CLOSE UBB_FORUM_SUMMARY.CGI **
** EDIT CP_COMMON.PL TEMPLATE **
Look for the following code:
document.writeln("<option value=$vars_config{CGIURL}/cp.cgi?ubb=vars_display&r=$ran> - General Display Settings</option>");
Underneath, add the following:
document.writeln("<option value=$vars_config{CGIURL}/cp.cgi?ubb=vars_news_fader&r=$ran> - News Fader Settings</option>");
** DONE - SAVE AND CLOSE CP_COMMON.PL TEMPLATE **
** EDIT PUBLIC_FORUM_SUMMARY.PL TEMPATE **
Look for:
# FORUM SUMMARY PAGE - HTML FRAGMENTS
Underneath add:
require "$vars_config{VariablesPath}/vars_news_fader.cgi";
Look for:
return($PageTop);
} ## END PAGE TOP
Underneath that add this:
# Start News Fader Stuff
if ($vars_news_fader{nfgreet} ne "") {
$NewsGreet = qq~"<b>$vars_news_fader{nfgreet}</b>","",~;
} else {
$NewsGreet = "";
}
if ($vars_news_fader{nfon} eq "ON") {
$newslinefader= qq~<TR bgcolor="$vars_style{CategoryStripColor}"><TD colspan="6">
<FONT SIZE="$vars_style{TextSize}" FACE="$vars_style{FontFace}" color="$vars_style{CategoryStripTextColor}"><B>$vars_news_fader{nftitle}</B></FONT>
</td></tr>
<tr>
<td colspan="6" bgcolor=$vars_style{AltColumnColor1} align=center>
<table border=0 cellpadding=0 cellspacing=0 align="center" width="$vars_style{TableWidth}">
<tr>
<td colspan="6" bgcolor=$vars_style{AltColumnColor1} align=center valign=top width=100% height=43><div id="elFader" style="position:relative;visibility:hidden;width:550"><div align="center"><font face="$vars_style{FontFace}" size="$vars_style{TextSize}">News Fader for DHTML Browser.</font></div></div>
</td></tr>
</table>
</td>
</tr>~;
} else {
$newslinefader = "";
}
# Run The News Fader
&ReadNews;
# End News Fader Stuff
Look for:
sub Normal_Table_Row {
my $Row = qq~
<tr>
<td bgcolor="$vars_style{AltColumnColor1}" valign="top" align="center">
Underneath add the following:
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--
NS4 = (document.layers);
IE4 = (document.all);
FDRboxWid = 480;
FDRboxHgt = 43;
FDRborWid = 0;
FDRborCol = "$vars_style{AltColumnColor1}";
FDRborSty = "solid";
FDRbackCol = "$vars_style{AltColumnColor1}";
FDRboxPad = 0;
FDRtxtAln = "center";
FDRlinHgt = "10pt";
FDRfntFam = "$vars_style{FontFace}";
FDRfntCol = "$vars_style{TextColor}";
FDRfntSiz = "9pt";
FDRfntWgh = "bold";
FDRfntSty = "normal";
FDRlnkCol = "$vars_style{LinkColor}";
FDRlnkDec = "underline";
FDRhovCol = "$vars_style{VisitedLinkColor}";
FDRgifSrc = "$vars_config{NonCGIURL}/fade.gif";
FDRgifInt = 60;
FDRblendInt = "$vars_news_fader{nfspan}";
FDRblendDur = 1;
FDRmaxLoops = 100;
FDRendWithFirst = true;
FDRreplayOnClick = true;
FDRjustFlip = false;
FDRhdlineCount = 0;
//-->
</SCRIPT>
<SCRIPT LANGUAGE='JavaScript1.2' TYPE='text/javascript'>
prefix="";
arNews = [
$NewsGreet
$the_page
]
</SCRIPT>
<SCRIPT LANGUAGE='JavaScript1.2' SRC='$vars_config{NonCGIURL}/fader.js' TYPE='text/javascript'>
</SCRIPT>
Look for:
~;
} # end mods column
$Top .= '</tr>';
return ($Top);
} #end normal_table_top
sub Cat_Table_Top {
Replace with:
~;
} # end mods column
$Top .= "</tr>$newslinefader";
$Top .= '</tr>';
return ($Top);
} #end normal_table_top
sub Cat_Table_Top
{** DONE - SAVE AND CLOSE PUBLIC_FORUM_SUMMARY.PL TEMPLATE **
Ok now you're done. Re-upload these four files. Next go into the Control Panel, Primary Settings -> News Fader Settings,
configure all of your settings and news headlines. Clear your cache and the next time you view your forum summary page,
the News Fader should be there.
[Fixed typo error in cp_news_fader.cgi]
[Fixed the edits in PUBLIC_FORUM_SUMMARY.PL]
Enjoy!
[ March 22, 2001: Message edited by: decimator ]